// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   UserPersistor.java

package org.fiel.persistence;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
import org.apache.commons.logging.Log;
import org.fiel.commons.jdbc.Persistor;
import org.fiel.domain.User;

public class UserPersistor extends Persistor
{

    public UserPersistor()
    {
    }

    protected Object extract(ResultSet rs)
    {
        User user = new User();
        try
        {
            user.setEmpresa(rs.getString("empresa"));
            user.setContacto(rs.getString("contacto"));
            java.sql.Date aSqlDate = rs.getDate("fechaven");
            user.setFechaven(aSqlDate == null ? null : new Date(aSqlDate.getTime()));
            user.setId(rs.getString("userid"));
            user.setIdentint(new Integer(rs.getInt("idenint")));
            user.setNivel(rs.getString("nivel"));
            user.setPassword(rs.getString("userpass"));
        }
        catch(SQLException e)
        {
            Persistor.logger.error(e.getMessage());
            return null;
        }
        return user;
    }

    public List FindAll(Map params)
    {
        return null;
    }

    public List getFields()
    {
        List ls = new ArrayList();
        ls.add("empresa");
        ls.add("userid");
        ls.add("userpass");
        ls.add("nivel");
        ls.add("contacto");
        ls.add("fechaven");
        ls.add("idenint");
        return ls;
    }

    protected List getOrderByFields()
    {
        return null;
    }

    protected String getTableNames()
    {
        return "usuarios";
    }
}
